package com.nbsaas.boot.tech.rest.resource;

import com.nbsaas.boot.tech.api.apis.TechnologyApi;
import com.nbsaas.boot.tech.data.entity.Technology;
import com.nbsaas.boot.tech.api.domain.request.TechnologyRequest;
import com.nbsaas.boot.tech.api.domain.response.TechnologyResponse;
import com.nbsaas.boot.tech.api.domain.simple.TechnologySimple;
import com.nbsaas.boot.tech.rest.convert.TechnologySimpleConvert;
import com.nbsaas.boot.tech.rest.convert.TechnologyEntityConvert;
import com.nbsaas.boot.tech.rest.convert.TechnologyResponseConvert;
import com.nbsaas.boot.tech.data.repository.TechnologyRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   技术-业务接口实现
*/
@Transactional
@Service
public class TechnologyResource extends BaseResource<Technology,TechnologyResponse, TechnologySimple, TechnologyRequest>  implements TechnologyApi {

    @Resource
    private TechnologyRepository technologyRepository;

    @Override
    public JpaRepositoryImplementation<Technology, Serializable> getJpaRepository() {
        return technologyRepository;
    }

    @Override
    public Function<Technology, TechnologySimple> getConvertSimple() {
        return new TechnologySimpleConvert();
    }

    @Override
    public Function<TechnologyRequest, Technology> getConvertForm() {
        return new TechnologyEntityConvert();
    }

    @Override
    public Function<Technology, TechnologyResponse> getConvertResponse() {
        return new TechnologyResponseConvert();
    }




}


